package com.testmanager.testmananger.shuiyou.strCompare.respository;

import com.testmanager.testmananger.shuiyou.strCompare.domain.SyDbManagerEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SyDbManagerRepository extends JpaRepository<SyDbManagerEntity,Long>, JpaSpecificationExecutor<SyDbManagerEntity>
, QuerydslPredicateExecutor<SyDbManagerEntity> {

    SyDbManagerEntity findById(long id);

    List<SyDbManagerEntity> findAllByProjectId(long projectId);

    SyDbManagerEntity findByDbno(String dbno);

    @Modifying
    Integer deleteAllByDbno(String dbno);
}
